Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: Make Tabs correctly handle a single Tab Button #1775

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

RubenSibon
Copy link
Contributor

@RubenSibon RubenSibon commented Dec 5, 2024

Describe the pull request

A fix for issue #1774 that Tabs List gives an breaking error when there is only one, non-iterable element in the Tabs List.

What

A Tabs List does not always expect multiple React Node's.

Why

Tabs (List) should be able to handle a single Tab button.

How

Remove the map method and just returning the value of children.

Checklist

Before submitting your pull request, please ensure you have done the following. Check each checkmark if you have done so or if it wasn't necessary:

  • Add or update stories (tested with stories)
  • Manually tested in Prototypes (Amopis)
  • Start the PR title with a Conventional Commit prefix, as explained here.

Additional notes

@RubenSibon RubenSibon added the bug Something isn't working label Dec 5, 2024
@RubenSibon RubenSibon self-assigned this Dec 5, 2024
@RubenSibon RubenSibon linked an issue Dec 5, 2024 that may be closed by this pull request
@VincentSmedinga VincentSmedinga changed the title fix!: Error in Tabs List when there is only one React Child fix!: Make Tabs correctly handle a single Tab Button Dec 10, 2024
@github-actions github-actions bot temporarily deployed to demo-DES-1094-tabs-list-with-one-child December 11, 2024 10:14 Destroyed
@RubenSibon
Copy link
Contributor Author

RubenSibon commented Dec 11, 2024

Tested it again in the Tabs Story and in the existing Tabs in Amopis in Prototypes. This PR seems to fix the bug.

@VincentSmedinga VincentSmedinga merged commit f8e89c1 into develop Dec 11, 2024
8 checks passed
@VincentSmedinga VincentSmedinga deleted the fix/DES-1094-tabs-list-with-one-child branch December 11, 2024 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

Tabs break when there is only one tab in <Tabs.List>
2 participants